<?xml version="1.0" encoding="iso-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
  <html xmlns="http://www.w3.org/1999/xhtml">
		<head>
			<!-- template designed by Marco Von Ballmoos -->
			<title>Docs For Class LockUtility</title>
			<link rel="stylesheet" href="../media/stylesheet.css" />
			<meta http-equiv='Content-Type' content='text/html; charset=iso-8859-1'/>
		</head>
		<body>
			<div class="page-body">			
<h2 class="class-name"><img src="../media/images/Class_logo.png"
														alt=" Class"
														title=" Class"
														style="vertical-align: middle"> LockUtility</h2>

<a name="sec-description"></a>
<div class="info-box">
	<div class="info-box-title">Description</div>
	<div class="nav-bar">
					<span class="disabled">Description</span> |
															<a href="#sec-method-summary">Methods</a> (<a href="#sec-methods">details</a>)
						
					</div>
	<div class="info-box-body">
        		<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">systemwide locking mechanism with timeout for critical sections or eventhandlers</p>
	<ul class="tags">
				<li><span class="field">author:</span> feldkamp@gameforge.de</li>
				<li><span class="field">author:</span> sven.bender@gameforge.de</li>
			</ul>
		<p class="notes">
			Located in <a class="field" href="_kata---lib---utilities---lockutility.php.html">/kata/lib/utilities/lockutility.php</a> (line <span class="field">16</span>)
		</p>
		
				
		<pre></pre>
	
			</div>
</div>




	<a name="sec-method-summary"></a>
	<div class="info-box">
		<div class="info-box-title">Method Summary</span></div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
												<span class="disabled">Methods</span> (<a href="#sec-methods">details</a>)
		</div>
		<div class="info-box-body">			
			<div class="method-summary">
																																																																<div class="method-definition">
					<img src="../media/images/Constructor.png" alt=" "/>
											<span class="method-result">LockUtility</span>
										<a href="#__construct" title="details" class="method-name">__construct</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Destructor.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#__destruct" title="details" class="method-name">__destruct</a>
										()
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#garbageCollect" title="details" class="method-name">garbageCollect</a>
											([<span class="var-type">bool</span>&nbsp;<span class="var-name">$force</span> = <span class="var-default">false</span>])
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">bool,</span>
										<a href="#lock" title="details" class="method-name">lock</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$waitForTimeout</span> = <span class="var-default">true</span>], <span class="var-type">int</span>&nbsp;<span class="var-name">$id,</span>, <span class="var-type">bool</span>&nbsp;<span class="var-name">$waitForTimeout,</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">void</span>
										<a href="#setTimeout" title="details" class="method-name">setTimeout</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$timeout</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$timout</span>)
									</div>
																<div class="method-definition">
					<img src="../media/images/Method.png" alt=" "/>
											<span class="method-result">true</span>
										<a href="#unlock" title="details" class="method-name">unlock</a>
											(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$id,</span>)
									</div>
											</div>
		</div>
	</div>		

	
	<a name="sec-methods"></a>
	<div class="info-box">
		<div class="info-box-title">Methods</div>
		<div class="nav-bar">
			<a href="#sec-description">Description</a> |
													<a href="#sec-method-summary">Methods</a> (<span class="disabled">details</span>)
						
		</div>
		<div class="info-box-body">
			<A NAME='method_detail'></A>
<a name="method__construct" id="__construct"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Constructor.png" />
		<span class="method-title">Constructor __construct</span> (line <span class="line-number">41</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">setup up session directory</p>
	
	<div class="method-signature">
		<span class="method-result">LockUtility</span>
		<span class="method-name">
			__construct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="method__destruct" id="__destruct"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Destructor.png" />
		<span class="method-title">Destructor __destruct</span> (line <span class="line-number">140</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">output a word of warning if we forgot to unlock some ids</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			__destruct
		</span>
				()
			</div>
	
		
			
	</div>
<a name="methodgarbageCollect" id="garbageCollect"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">garbageCollect</span> (line <span class="line-number">117</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">clean up leftover lockfiles</p>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			garbageCollect
		</span>
					([<span class="var-type">bool</span>&nbsp;<span class="var-name">$force</span> = <span class="var-default">false</span>])
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$force</span><span class="var-description">: collect now, even if propability is unmet</span>			</li>
				</ul>
		
			
	</div>
<a name="methodlock" id="lock"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">lock</span> (line <span class="line-number">52</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Lock a user id</p>
	<ul class="tags">
				<li><span class="field">return:</span> returns true if the user was locked</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">bool,</span>
		<span class="method-name">
			lock
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, [<span class="var-type"></span>&nbsp;<span class="var-name">$waitForTimeout</span> = <span class="var-default">true</span>], <span class="var-type">int</span>&nbsp;<span class="var-name">$id,</span>, <span class="var-type">bool</span>&nbsp;<span class="var-name">$waitForTimeout,</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$id,</span><span class="var-description">: id of the user to lock.</span>			</li>
					<li>
				<span class="var-type">bool</span>
				<span class="var-name">$waitForTimeout,</span><span class="var-description">: wait for time out</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$waitForTimeout</span>			</li>
				</ul>
		
			
	</div>
<a name="methodsetTimeout" id="setTimeout"><!-- --></a>
<div class="oddrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">setTimeout</span> (line <span class="line-number">30</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
	<ul class="tags">
				<li><span class="field">access:</span> public</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">void</span>
		<span class="method-name">
			setTimeout
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$timeout</span>, <span class="var-type">integer</span>&nbsp;<span class="var-name">$timout</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">integer</span>
				<span class="var-name">$timout</span><span class="var-description">: how many seconds to wait for a lock before we fail</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$timeout</span>			</li>
				</ul>
		
			
	</div>
<a name="methodunlock" id="unlock"><!-- --></a>
<div class="evenrow">
	
	<div class="method-header">
		<img src="../media/images/Method.png" />
		<span class="method-title">unlock</span> (line <span class="line-number">91</span>)
	</div> 
	
	<!-- ========== Info from phpDoc block ========= -->
<p class="short-description">Unlock a user id</p>
	<ul class="tags">
				<li><span class="field">return:</span> if the user was unlocked</li>
			</ul>
	
	<div class="method-signature">
		<span class="method-result">true</span>
		<span class="method-name">
			unlock
		</span>
					(<span class="var-type"></span>&nbsp;<span class="var-name">$id</span>, <span class="var-type">int</span>&nbsp;<span class="var-name">$id,</span>)
			</div>
	
			<ul class="parameters">
					<li>
				<span class="var-type">int</span>
				<span class="var-name">$id,</span><span class="var-description">: id of the user to lock</span>			</li>
					<li>
				<span class="var-type"></span>
				<span class="var-name">$id</span>			</li>
				</ul>
		
			
	</div>
						
		</div>
	</div>

	
	<p class="notes" id="credit">
		Documentation generated on Thu, 23 Sep 2010 16:25:55 +0200 by <a href="http://www.phpdoc.org" target="_blank">phpDocumentor 1.4.1</a>
	</p>
	</div></body>
</html>